var UITree = function() {

	var contextualMenuSample = function() {
		var testTree = $("#tree_3").jstree({
			"core" : {
				"themes" : {
					"responsive" : false
				},
				// so that create works
				"check_callback" : true,
				'data' : [ {
					"text" : "产品",
					"type" : "root-folder",
					"children" : [ {
						"text" : "列表-显示字段",
						"icon" : "fa fa-folder icon-state-success",
						"type" : "folder",
						"opened" : true,
						"children" : [ {
							"type" : "file",
							"text" : "Item 1",
							"icon" : "fa fa-file icon-state-warning"
						}, {
							"type" : "file",
							"text" : "Item 2",
							"icon" : "fa fa-file icon-state-success"
						}, {
							"type" : "file",
							"text" : "Item 3",
							"icon" : "fa fa-file icon-state-default"
						}, {
							"type" : "file",
							"text" : "Item 4",
							"icon" : "fa fa-file icon-state-danger"
						}, {
							"type" : "file",
							"text" : "Item 5",
							"icon" : "fa fa-file icon-state-info"
						} ]
					}, {
						"text" : "列表-隐藏字段",
						"icon" : "fa fa-folder icon-state-danger",
						"type" : "folder",
						"state" : {
							"opened" : true
						},
						"children" : [ {
							"type" : "file",
							"text" : "Another node",
							"icon" : "fa fa-file icon-state-warning"
						} ]
					}, ]
				}]
			},
			"types" : {
				"root-folder" : {
					"valid_children" : ['folder'],
					"icon" : "fa fa-folder icon-state-warning icon-lg"
				},
				"folder" : {
					"valid_children" : ['file'],
					"icon" : "fa fa-folder icon-state-warning icon-lg"
				},
				"file" : {
					"valid_children" : [],
					"icon" : "fa fa-file icon-state-warning icon-lg"
				}
			},
			"state" : {
				"key" : "demo2"
			},
			"plugins" : [ "dnd", "state", "types" ]
		});
		
		Object nodes = $("#tree_3").jstree("get_json");
	}

	return {
		//main function to initiate the module
		init : function() {
			contextualMenuSample();
		}
	};

}();

if (App.isAngularJsApp() === false) {
	jQuery(document).ready(function() {
		UITree.init();
	});
}